import emitter from "@/utils/emitter.js";

class clickEvent {
    constructor(graph, optionsConfig) {
        this.graph = graph
        this.optionsConfig = optionsConfig
    }

    init() {
        // 节点点击事件
        this.graph.on("node:click", (event) => {

        })

        // 画布单击事件
        this.graph.on("canvas:click", async (event) => {
            console.log(this.graph.getData(), 222)
        })
        // 节点双击事件
        this.graph.on("node:dblclick", (event) => {
        })
        // 画布双击事件
        this.graph.on("canvas:wheel", async (event) => {
            console.log(this.graph.getZoom())
            emitter.emit('canvasWheel', this.graph.getZoom())
        })
    }
}

export default clickEvent;
